/*
* Author:      Marco Kuiper (http://www.marcofolio.net/)
*/
google.load("jquery", "1.3.1");
google.setOnLoadCallback(function()
{
	// Safely inject CSS3 and give the search results a shadow
	var cssObj = { }; // Firefox 3.5+
	$("#suggestions").css(cssObj);
	
	// Fade out the suggestions box when not active
	 $("input").blur(function(){
	 	$('#suggestions').fadeOut();
	 });
});

function lookup(inputString) {
var base_url=$('#base-url').text();
	if(inputString.length == 0) {
		$('#suggestions').fadeOut(); // Hide the suggestions box
	} else {
		$.post(base_url+"/Homes/autocompletesearch", {queryString: ""+inputString+""}, function(data) { // Do an AJAX call
			$('#suggestions').fadeIn(); // Show the suggestions box
			$('#suggestions').html(data); // Fill the suggestions box
		});
	}
}
function lookup1(inputString) {
var base_url=$('#base-url').text();
	if(inputString.length == 0) {
		$('#suggestions1').fadeOut(); // Hide the suggestions box
	} else {
		$.post(base_url+"/Homes/autocompletesearch", {queryString: ""+inputString+""}, function(data) { // Do an AJAX call
			$('#suggestions1').fadeIn(); // Show the suggestions box
			$('#suggestions1').html(data); // Fill the suggestions box
                        $('html, body').animate({
                            scrollTop: $(document).height()
                        },
                        1000);
		});
	}
}
